package com.teradyne.phoenix.client.views;

import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
import com.google.gwt.uibinder.client.UiField;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.LayoutPanel;
import com.teradyne.phoenix.client.factory.AppFactory;

public class AppLayoutImpl implements AppLayout {

	interface AppLayoutUiBinder extends UiBinder<DockLayoutPanel, AppLayoutImpl> {
	}
	
	private static AppLayoutUiBinder uiBinder = GWT.create(AppLayoutUiBinder.class);

	private DockLayoutPanel dock;
	
	@UiField
	ContentArea contentArea;
	
	@UiField(provided = true)
	AppMenuViewImpl menus;

	public AppLayoutImpl(AppFactory appFactory) {
		menus = appFactory.getAppMenuViewImpl();
		dock = uiBinder.createAndBindUi(this);
	}

	@Override
	public DockLayoutPanel getMainPanel() {
		return dock;
	}

	@Override
	public LayoutPanel getContentPanel() {
		return contentArea;
	}

}
